package com.cqeec.gams.mapper;

import java.util.List;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.test.context.ContextConfiguration;
import org.springframework.test.context.junit4.SpringJUnit4ClassRunner;

import com.cqeec.gams.entity.Role;
@RunWith(SpringJUnit4ClassRunner.class)
@ContextConfiguration("classpath:spring/applicationContext-*.xml")

public class TestRolemapper {
	
	@Autowired
	private RoleMapper roleMapper;

	@Test
	public void test() {
		System.out.println("角色记录有：" + roleMapper.countAll() + "条： ");
	}
	@Test
		public void testFindAll() {
			List<Role> list = roleMapper.findAll();
			for(Role r:list) {
				System.out.println(r.getId() + " " + r.getName());
			}
	}

}
